'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = (app) => {
    const { router, controller } = app;
    router.get('/', controller.home.index);

    // 注册接口
    router.post('/register', controller.home.register);
    // 登录接口
    router.post('/login', controller.home.login);

    // 添加成绩
    router.post('/scores', controller.score.create);
    router.get('/scores', controller.score.index);
    router.put('/scores/:id', controller.score.update);
    router.delete('/scores/:id', controller.score.destroy);
};
